home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Button2: TButton;
- Label4: TLabel;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- uses
- AASimAnn;
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- TextLog : TFileStream;
- begin
- TextLog := nil;
- try
- Label1.Caption := 'Running...';
- Label1.Update;
- TextLog := TFileStream.Create('c:\TrvSales.LOG', fmCreate);
- TravelingSalesman(100, TextLog);
- finally
- TextLog.Free;
- Label1.Caption := 'Done!';
- end;
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- var
- TextLog : TFileStream;
- begin
- TextLog := nil;
- try
- Label4.Caption := 'Running...';
- Label4.Update;
- TextLog := TFileStream.Create('c:\Knapsack.LOG', fmCreate);
- SolveKnapsackProblem(100, TextLog);
- finally
- TextLog.Free;
- Label4.Caption := 'Done!';
- end;
- end;
-
- end.
-